// MobileRadioView.h : interface of the CMobileRadioView class
//
/////////////////////////////////////////////////////////////////////////////

#pragma once
#include <atlddx.h>
#include <atlcrack.h>
#include "Station.h"

class CMobileRadioView : 
	public CAxDialogImpl<CMobileRadioView>,
	public CWinDataExchange<CMobileRadioView>
{
private:
	StationMap stationMap;
	CityStationMap cityStationMap;
	std::string path;

private:
	void LoadConfig();

	void Init();
	void CleanUp();
	
	std::string& GetCurrentPath(); 

public:
	CComboBox m_wndCity;
	CComboBox m_wndStation;
	CStatic m_wndPic;
	
public:
	enum { IDD = IDD_MOBILERADIO_FORM };
	
	BOOL PreTranslateMessage(MSG* pMsg);

	BEGIN_MSG_MAP(CMobileRadioView)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
//		MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
		COMMAND_HANDLER_EX(IDC_COMBO_CITY, CBN_SELCHANGE, OnComboCityCbnSelChange)
		COMMAND_HANDLER_EX(IDC_COMBO_STATION, CBN_SELCHANGE, OnComboStationCbnSelChange)
	END_MSG_MAP()

	BEGIN_DDX_MAP(CMobileRadioView)
		DDX_CONTROL_HANDLE(IDC_COMBO_CITY, m_wndCity)
		DDX_CONTROL_HANDLE(IDC_COMBO_STATION, m_wndStation)
		DDX_CONTROL_HANDLE(IDC_PIC, m_wndPic)
	END_DDX_MAP()


// Handler prototypes (uncomment arguments if needed):
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);

private:
	CComQIPtr<IWMPPlayer> m_spWMPPlayer;
	CAxWindow m_wndWMP;
public:
	LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnComboCityCbnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl);
	LRESULT OnComboStationCbnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl);
};

